package com.wsl.mybatiscustomframe.session;

import com.wsl.mybatiscustomframe.execute.Executor;
import com.wsl.mybatiscustomframe.execute.SimpleExecutor;
import com.wsl.mybatiscustomframe.pojo.Configuration;


/**
 * packageName com.wsl.mybatiscustomframe.session  DefatultSqlSessionFactory
 *
 * @author victor
 * @version JDK 8
 * @date 2024/7/11
 * @description TODO
 */
public class DefatultSqlSessionFactory implements SqlSessionFactory {



    private Configuration configuration;
    public DefatultSqlSessionFactory(Configuration configuration) {
        this.configuration = configuration;
    }


    @Override
    public SqlSession openSession() {
        // 执行器创建出来
        Executor executor = new SimpleExecutor();
        DefaultSqlSession defaultSqlSession = new
                DefaultSqlSession(configuration,executor);
        return defaultSqlSession;
    }
}
